package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.FacilityBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface IFacilityMapper extends BaseMapper<FacilityBean> {


    @Select("SELECT * FROM t_room r LEFT JOIN t_facility ON pk_roomId=fk_roomId WHERE pk_roomId=#{roomId}")
    @ResultMap("facilityMap")
    public List<FacilityBean> findByRoom(Integer roomId);


    public int findFacilityNum(@Param("roomId") Integer roomId, @Param("state") String setStatus);

    @Delete("delete from t_facility where fk_roomID=#{roomId}")
    public void delByRoomId(Integer roomId);

}
